Skip to content

bash: Fix shellcheck lint#145830

Merged
roberth merged 1 commit intoNixOS:masterfrom
l0b0:fix-shellcheck-lints
Nov 28, 2021
Merged

bash: Fix shellcheck lint#145830
roberth merged 1 commit intoNixOS:masterfrom
l0b0:fix-shellcheck-lints

Conversation

@l0b0
Copy link
Contributor

@l0b0 l0b0 commented Nov 14, 2021

Motivation for this change

Existing issues requesting ShellCheck compliance: #133088, #21166.

This change mostly prepares for ShellCheck by indicating which shell (Bash in all the cases I could find) ShellCheck should interpret the code as, and by configuring pre-commit to use the latest version of ShellCheck.

Let me know if this should be split up in some other way.

The EditorConfig errors seem to be from the existing source - I've create a separate PR (merged) to fix those.

Note to self: To list all paths with a specific issue, change .pre-commit-config.yaml to set e.g.

args: [--format=json, --include=SC1008]
require_serial: true

Then pre-commit run --all-files | tail +5 | jq --raw-output '.[] | .file' | xargs --max-args=1 idea-ultimate to pass all the files to IDEA.

Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 21.11 Release Notes (or backporting 21.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. labels Nov 14, 2021
@l0b0 l0b0 force-pushed the fix-shellcheck-lints branch from f3d6e83 to 1d14ca9 Compare November 14, 2021 01:14
@github-actions github-actions bot added 6.topic: emacs Text editor 6.topic: erlang General-purpose, concurrent, functional high-level programming language 6.topic: haskell General-purpose, statically typed, purely functional programming language 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 6.topic: python Python is a high-level, general-purpose programming language. 6.topic: qt/kde Object-oriented framework for GUI creation 6.topic: rust General-purpose programming language emphasizing performance, type safety, and concurrency. 8.has: documentation This PR adds or changes documentation 8.has: module (update) This PR changes an existing module in `nixos/` 6.topic: kernel The Linux kernel labels Nov 14, 2021
@l0b0 l0b0 marked this pull request as ready for review November 14, 2021 02:59
@l0b0 l0b0 force-pushed the fix-shellcheck-lints branch 2 times, most recently from 5a01f5f to 0778260 Compare November 17, 2021 05:12
@l0b0
Copy link
Contributor Author

l0b0 commented Nov 17, 2021

Ping?

.gitignore Outdated
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's this for?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's the JetBrains IDEA module declaration file, which is created automatically when opening the project.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/nixpkgs.iml
# JetBrains IDEA module declaration file
/nixpkgs.iml

Git's intent was for these to be in user gitignores, but that's not what's done in practice, fwiw.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It disappeared.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved to #146607.

@roberth
Copy link
Member

roberth commented Nov 17, 2021

Please rebase so that ci can succeed.

@l0b0 l0b0 force-pushed the fix-shellcheck-lints branch 2 times, most recently from db4c9c0 to ecc4e91 Compare November 19, 2021 06:23
@l0b0 l0b0 requested a review from roberth November 19, 2021 08:57
@l0b0 l0b0 force-pushed the fix-shellcheck-lints branch from cc0eb0c to b717eb3 Compare November 19, 2021 09:15
@l0b0 l0b0 marked this pull request as draft November 19, 2021 10:48
@l0b0
Copy link
Contributor Author

l0b0 commented Nov 19, 2021

Splitting out some changes, please hold.

@l0b0 l0b0 force-pushed the fix-shellcheck-lints branch from b717eb3 to 00324d9 Compare November 19, 2021 11:07
@l0b0
Copy link
Contributor Author

l0b0 commented Nov 19, 2021

I've split the changes into #146601, #146607, #146608 and #146610.

@l0b0 l0b0 changed the title Fix shellcheck lints bash: Fix shellcheck lints Nov 19, 2021
@l0b0 l0b0 changed the title bash: Fix shellcheck lints bash: Fix shellcheck lint Nov 19, 2021
@github-actions github-actions bot removed 6.topic: erlang General-purpose, concurrent, functional high-level programming language 6.topic: rust General-purpose programming language emphasizing performance, type safety, and concurrency. 6.topic: kernel The Linux kernel 6.topic: emacs Text editor 8.has: documentation This PR adds or changes documentation 6.topic: haskell General-purpose, statically typed, purely functional programming language 6.topic: qt/kde Object-oriented framework for GUI creation 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` labels Nov 19, 2021
@l0b0 l0b0 changed the base branch from staging to master November 19, 2021 11:08
@l0b0 l0b0 marked this pull request as ready for review November 19, 2021 11:08
@github-actions github-actions bot removed the 6.topic: python Python is a high-level, general-purpose programming language. label Nov 19, 2021
@ofborg ofborg bot removed the 10.rebuild-darwin-stdenv This PR causes stdenv to rebuild on Darwin and must target a staging branch. label Nov 19, 2021
@l0b0
Copy link
Contributor Author

l0b0 commented Nov 27, 2021

@Artturin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants